package org.xxpay.pay.channel.yunsfpay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * @Description 云闪付配置文件
 * @author hjj
 * @email  1977947499@qq.com
 * @EditDate  2019年1月18日 下午14:17:23
 *
 */
@Component
public class YunsfpayConfig {

    // 渠道名称
    public final static String CHANNEL_NAME = "yunsfpay";
    // 支付宝扫码
    public final static String PAY_CHANNEL_YUNSFPAY_QR = CHANNEL_NAME + "_qr";


    // 商户ID
    private String mchId;
    // 商户Key
    private String key;
    // 请求地址
    private String reqUrl;
    // 异步通知地址
   // private String notifyUrl;

    public YunsfpayConfig() {
    }

    public YunsfpayConfig(String payParam) {
        Assert.notNull(payParam, "init fopay config error");
        JSONObject object = JSONObject.parseObject(payParam);
        this.mchId = object.getString("mchId");
        this.key = object.getString("key");
        this.reqUrl = object.getString("reqUrl");
        //this.notifyUrl = object.getString("notifyUrl");
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getReqUrl() {
        return reqUrl;
    }

    public void setReqUrl(String reqUrl) {
        this.reqUrl = reqUrl;
    }

    //public void setNotifyUrl(String notifyUrl) {
    //    this.notifyUrl = notifyUrl;
   // }

   // public String getNotifyUrl() {
   //     return notifyUrl;
   // }

   
}
